package action;

import java.util.List;

import model.Menu;
import service.SubMenuManageService;

import com.opensymphony.xwork2.ActionSupport;

public class SubMenuManageAction extends ActionSupport{

	private SubMenuManageService subMenuManageService;
	private List menuList;
	private Menu menu;
	private int id;
	
	public String saveMenu(Menu menu){
		subMenuManageService.saveMenu(menu);
		return SUCCESS;
	}
	public String deleteMenu(Menu menu){
		subMenuManageService.deleteMenu(menu);
		return SUCCESS;
	}
	public String updateMenu(Menu menu){
		subMenuManageService.updateMenu(menu);
		return SUCCESS;
	}
	
	public String findAllSubMenu(){
		this.setMenuList(subMenuManageService.findAllSubMenu());
		return SUCCESS;
	}
	
	public String findAllSubMenuById(){
		this.setMenuList(subMenuManageService.findAllSubMenuById(id));
		return SUCCESS;
	}
	
	public List getMenuList() {
		return menuList;
	}
	public void setMenuList(List menuList) {
		this.menuList = menuList;
	}
	public Menu getMenu() {
		return menu;
	}
	public void setMenu(Menu menu) {
		this.menu = menu;
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public void setSubMenuManageService(SubMenuManageService subMenuManageService) {
		this.subMenuManageService = subMenuManageService;
	}
	
	
}
